package com.lifeng.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author lifeng
 * @version v1.0
 * @date 2020/11/6 18:04
 * @description
 */
@RestController
public class UserController {
    @Resource
    private RedisTemplate redisTemplate;
    @Value("${app.version:0}")
    private String version;

    @RequestMapping("/demo")
    public String demo(){
        redisTemplate.opsForValue().set("tmp:"+System.currentTimeMillis(),version);
        return "ok";
    }

}
